#include <iostream>
#define N 100


using namespace std;

void mirr(char array[], int elements){
int i,j, aux;
i=0;
j=elements-1;
while (i<j){
    aux=array[i];
    array[i]=array[j];
    array[j]=aux;
    ++i;
    --j;}
}

void arraycopy(char source[], char destination[], int length){
int i, l=length;
for (i=0; i<l; i++)
    destination[i]=source[i];
}


int palindrom(char s[], char array[], int elements){
int i;
for(i=0;i<elements;i++)
    if(s[i]!=array[i])
        return 0;
return 1;
}

void printcharVector(char array[], int elements){
int i;
for(i=0;i<elements;i++){
    cout<<array[i]<<" ";}
	cout<<"\n";
}

void readcharVector(char array[], int elements){
int i;
for(i=0;i<elements;i++){
    cout<<"a["<<i<<"]=";
    cin>>array[i];
    cout<<"\n";}
}


int main(){
int elements;
char array[N], s[N];
cout<<"Type the number of elements you want in the array : ";
cin>>elements;
readcharVector(array, elements);
arraycopy(array, s, elements);
mirr(array, elements);
if (palindrom(s, array, elements)!=0){
	printcharVector(s, elements);
	cout<<"is a palindrome\n"<<" "<<endl;}
else {
	printcharVector(s, elements);
	cout<<"is not a palindrome"<<" "<<endl;}
return 0;
}
